package com.evildog.workspace.system.api.feign;

import com.evildog.workspace.common.result.Result;
import com.evildog.workspace.system.api.consts.SystemApiConst;
import com.evildog.workspace.system.api.vo.UserVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * <p>
 * User feign
 * </p>
 *
 * @author evildog
 * @since 2020-07-18
 */
@FeignClient(
        contextId = "users",
        value = SystemApiConst.SERVICE_NAME
)
public interface UserClient {

    String API_PREFIX = "/users-feign";

    @GetMapping(API_PREFIX + "/login")
    Result<UserVO> getUser(@RequestParam String account, @RequestParam String password);

    @GetMapping(API_PREFIX + "/{userId}")
    Result<UserVO> getUser(@PathVariable Long userId);

}